Optimal. Leaf size=202 \[ -\frac {(6 B-13 C) \tanh ^{-1}(\sin (c+d x))}{2 a^3 d}+\frac {8 (9 B-19 C) \tan (c+d x)}{15 a^3 d}-\frac {(6 B-13 C) \sec (c+d x) \tan (c+d x)}{2 a^3 d}+\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.39, antiderivative size = 202, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 7, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.175, Rules used = {4157, 4104,
3872, 3852, 8, 3853, 3855} \begin {gather*} \frac {8 (9 B-19 C) \tan (c+d x)}{15 a^3 d}-\frac {(6 B-13 C) \tanh ^{-1}(\sin (c+d x))}{2 a^3 d}+\frac {4 (9 B-19 C) \tan (c+d x) \sec ^2(c+d x)}{15 d \left (a^3 \sec (c+d x)+a^3\right )}-\frac {(6 B-13 C) \tan (c+d x) \sec (c+d x)}{2 a^3 d}+\frac {(B-C) \tan (c+d x) \sec ^4(c+d x)}{5 d (a \sec (c+d x)+a)^3}+\frac {(6 B-11 C) \tan (c+d x) \sec ^3(c+d x)}{15 a d (a \sec (c+d x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3853
Rule 3855
Rule 3872
Rule 4104
Rule 4157
Rubi steps
\begin {align*} \int \frac {\sec ^4(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{(a+a \sec (c+d x))^3} \, dx &=\int \frac {\sec ^5(c+d x) (B+C \sec (c+d x))}{(a+a \sec (c+d x))^3} \, dx\\ &=\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {\int \frac {\sec ^4(c+d x) (4 a (B-C)-a (2 B-7 C) \sec (c+d x))}{(a+a \sec (c+d x))^2} \, dx}{5 a^2}\\ &=\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {\int \frac {\sec ^3(c+d x) \left (3 a^2 (6 B-11 C)-a^2 (18 B-43 C) \sec (c+d x)\right )}{a+a \sec (c+d x)} \, dx}{15 a^4}\\ &=\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )}+\frac {\int \sec ^2(c+d x) \left (8 a^3 (9 B-19 C)-15 a^3 (6 B-13 C) \sec (c+d x)\right ) \, dx}{15 a^6}\\ &=\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )}+\frac {(8 (9 B-19 C)) \int \sec ^2(c+d x) \, dx}{15 a^3}-\frac {(6 B-13 C) \int \sec ^3(c+d x) \, dx}{a^3}\\ &=-\frac {(6 B-13 C) \sec (c+d x) \tan (c+d x)}{2 a^3 d}+\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )}-\frac {(6 B-13 C) \int \sec (c+d x) \, dx}{2 a^3}-\frac {(8 (9 B-19 C)) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{15 a^3 d}\\ &=-\frac {(6 B-13 C) \tanh ^{-1}(\sin (c+d x))}{2 a^3 d}+\frac {8 (9 B-19 C) \tan (c+d x)}{15 a^3 d}-\frac {(6 B-13 C) \sec (c+d x) \tan (c+d x)}{2 a^3 d}+\frac {(B-C) \sec ^4(c+d x) \tan (c+d x)}{5 d (a+a \sec (c+d x))^3}+\frac {(6 B-11 C) \sec ^3(c+d x) \tan (c+d x)}{15 a d (a+a \sec (c+d x))^2}+\frac {4 (9 B-19 C) \sec ^2(c+d x) \tan (c+d x)}{15 d \left (a^3+a^3 \sec (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(428\) vs. \(2(202)=404\).
time = 2.07, size = 428, normalized size = 2.12 \begin {gather*} \frac {\cos ^4\left (\frac {1}{2} (c+d x)\right ) \sec ^2(c+d x) \left (30 (6 B-13 C) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+16 (12 B+13 C) \csc ^3(c+d x) \sin ^4\left (\frac {1}{2} (c+d x)\right )+4 (87 B-197 C) \tan \left (\frac {1}{2} (c+d x)\right )+(-21 B+31 C+(24 B-34 C) \cos (c+d x)) \sec ^4\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )-60 (6 B-13 C) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right )-64 (9 B-19 C) \tan ^3\left (\frac {1}{2} (c+d x)\right )-(-6 B+11 C+(12 B-17 C) \cos (c+d x)) \sec ^4\left (\frac {1}{2} (c+d x)\right ) \tan ^3\left (\frac {1}{2} (c+d x)\right )+30 (6 B-13 C) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \tan ^4\left (\frac {1}{2} (c+d x)\right )+\left (228 B-428 C+3 (B-C) \sec ^4\left (\frac {1}{2} (c+d x)\right )\right ) \tan ^5\left (\frac {1}{2} (c+d x)\right )\right )}{60 a^3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.54, size = 206, normalized size = 1.02
method | result | size |
derivativedivides | \(\frac {\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{5}-\frac {C \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+2 B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {8 C \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+17 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-31 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {-14 C +4 B}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\left (26 C -12 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {2 C}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\left (-26 C +12 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {-14 C +4 B}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\frac {2 C}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}}{4 d \,a^{3}}\) | \(206\) |
default | \(\frac {\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{5}-\frac {C \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+2 B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {8 C \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+17 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-31 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {-14 C +4 B}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\left (26 C -12 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {2 C}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\left (-26 C +12 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {-14 C +4 B}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\frac {2 C}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}}{4 d \,a^{3}}\) | \(206\) |
norman | \(\frac {\frac {\left (B -C \right ) \left (\tan ^{15}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 a d}+\frac {\left (3 B -5 C \right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 a d}-\frac {25 \left (9 B -19 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 a d}-\frac {\left (25 B -51 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}+\frac {\left (27 B -59 C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 a d}+\frac {\left (345 B -721 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 a d}+\frac {\left (549 B -1165 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 a d}-\frac {\left (3123 B -6613 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{60 a d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{5} a^{2}}+\frac {\left (6 B -13 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 a^{3} d}-\frac {\left (6 B -13 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 a^{3} d}\) | \(280\) |
risch | \(\frac {i \left (90 B \,{\mathrm e}^{8 i \left (d x +c \right )}-195 C \,{\mathrm e}^{8 i \left (d x +c \right )}+450 B \,{\mathrm e}^{7 i \left (d x +c \right )}-975 C \,{\mathrm e}^{7 i \left (d x +c \right )}+1050 B \,{\mathrm e}^{6 i \left (d x +c \right )}-2275 C \,{\mathrm e}^{6 i \left (d x +c \right )}+1650 B \,{\mathrm e}^{5 i \left (d x +c \right )}-3575 C \,{\mathrm e}^{5 i \left (d x +c \right )}+2094 B \,{\mathrm e}^{4 i \left (d x +c \right )}-4329 C \,{\mathrm e}^{4 i \left (d x +c \right )}+1830 B \,{\mathrm e}^{3 i \left (d x +c \right )}-3805 C \,{\mathrm e}^{3 i \left (d x +c \right )}+1278 B \,{\mathrm e}^{2 i \left (d x +c \right )}-2673 C \,{\mathrm e}^{2 i \left (d x +c \right )}+630 B \,{\mathrm e}^{i \left (d x +c \right )}-1325 C \,{\mathrm e}^{i \left (d x +c \right )}+144 B -304 C \right )}{15 d \,a^{3} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{5} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{a^{3} d}-\frac {13 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{2 a^{3} d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{a^{3} d}+\frac {13 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{2 a^{3} d}\) | \(324\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 377, normalized size = 1.87 \begin {gather*} -\frac {C {\left (\frac {60 \, {\left (\frac {5 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {7 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{3} - \frac {2 \, a^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\frac {465 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {40 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{3}} - \frac {390 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{3}} + \frac {390 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{3}}\right )} - 3 \, B {\left (\frac {40 \, \sin \left (d x + c\right )}{{\left (a^{3} - \frac {a^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} + \frac {\frac {85 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {10 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {\sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{3}} - \frac {60 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{3}} + \frac {60 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{3}}\right )}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.69, size = 295, normalized size = 1.46 \begin {gather*} -\frac {15 \, {\left ({\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{5} + 3 \, {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left ({\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{5} + 3 \, {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (6 \, B - 13 \, C\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (16 \, {\left (9 \, B - 19 \, C\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (114 \, B - 239 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (234 \, B - 479 \, C\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (2 \, B - 3 \, C\right )} \cos \left (d x + c\right ) + 15 \, C\right )} \sin \left (d x + c\right )}{60 \, {\left (a^{3} d \cos \left (d x + c\right )^{5} + 3 \, a^{3} d \cos \left (d x + c\right )^{4} + 3 \, a^{3} d \cos \left (d x + c\right )^{3} + a^{3} d \cos \left (d x + c\right )^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {B \sec ^{5}{\left (c + d x \right )}}{\sec ^{3}{\left (c + d x \right )} + 3 \sec ^{2}{\left (c + d x \right )} + 3 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \sec ^{6}{\left (c + d x \right )}}{\sec ^{3}{\left (c + d x \right )} + 3 \sec ^{2}{\left (c + d x \right )} + 3 \sec {\left (c + d x \right )} + 1}\, dx}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.52, size = 233, normalized size = 1.15 \begin {gather*} -\frac {\frac {30 \, {\left (6 \, B - 13 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{3}} - \frac {30 \, {\left (6 \, B - 13 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{3}} + \frac {60 \, {\left (2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 7 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a^{3}} - \frac {3 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 30 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, C a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 255 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 465 \, C a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{15}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.84, size = 216, normalized size = 1.07 \begin {gather*} \frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,\left (B-C\right )}{2\,a^3}+\frac {3\,\left (3\,B-5\,C\right )}{4\,a^3}+\frac {2\,B-10\,C}{4\,a^3}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,B-7\,C\right )-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,B-5\,C\right )}{d\,\left (a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^3\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {B-C}{4\,a^3}+\frac {3\,B-5\,C}{12\,a^3}\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (B-C\right )}{20\,a^3\,d}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (6\,B-13\,C\right )}{a^3\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________